<template>
	<view>
		<u-navbar title-color="#333" back-icon-color="#333" :border-bottom="false" :is-fixed="true"
			:background="{background:'transparent'}" :is-back="true">

		</u-navbar>
		<!-- 用户信息 -->
		<cxView marginBottom="50">
			<cxView display="flex" justify-content="center" align-items="center" flexDirection="column" marginTop="60">
				<u-avatar :src="userInfo.avatar" size="100" level-icon="photo" :show-level='false'></u-avatar>


				<cxView marginTop="20" display="flex" alignItems="center">
					<cxView size="40">{{userInfo.nickName}}</cxView>
				</cxView>
				<cxView marginTop="20">
					{{userInfo.phonenumber}}
				</cxView>

			</cxView>
		</cxView>

		<cxBottom position="" background="transparent" :btn-bg="$cx.color.cxMainColor" @confirm="changePwd">修改密码
		</cxBottom>

		<cxBottom @confirm="quitClick" position="" background="transparent" :btn-bg="$cx.color.cxMainColor"
			margin="20 10 0 10">
			退出登录
		</cxBottom>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: this.$userInfo(),
			}
		},
		onLoad() {
			this.$log("userinf----", this.$userInfo())
		},

		methods: {
			quitClick() {
				uni.clearStorage();
				uni.reLaunch({
					url: '/pages/login/login'
				})
			},
			changePwd() {
				uni.$u.route({
					url: "/pages/login/resetPwd",
					params: {}
				})
			}
		}
	}
</script>

<style>

</style>